import type { QuestionItem } from './question'

// 考考你详情
export interface QuizInfo {
    id: number
    course_id: number
    unit_id: number
    title: string
    description: string
    question_category_id: number
    question_num: number
    sort_order: number
    type: string
    pass_score: string
    total_score: string
    category_name: string
    category_description: string
    unit_title: string
    course_name: string
    completion_status: number
    highest_score: number
    completed_answers_count: number
    completed_students_count: number
}

// 答题记录
export interface AnswerItem {
    id: number
    quiz_id: number
    student_id: number
    total_score: string
    actual_score: string
    status: number // 1-进行中 2-已完成
    start_time: string
    end_time: string
    duration: string
    questions: QuestionItem[] // 问题
    user_answer: UserAnswer[] // 学生填写的答案
    grade_answer: GradeAnswer[] // 判卷结果
    status_text: string
}

export interface UserAnswer {
    question_id: number
    selected_option_ids: number[]
}

export interface GradeAnswer {
    comment: string
    correct_option_ids: number[]
    is_correct: boolean
    max_score: string
    question_id: number
    score: string
    selected_option_ids: number[]
    log: {
        time: string
        score: string
        tatus: string
        action: string
    }[]
}

// 老师端-答卷记录筛选
export interface AnswerReportItem {
    id: number
    student_id: number
    first_name: string
    last_name: string
    additional_first_name: string
    additional_last_name: string
    code: string
    email: string
    status: number
    status_text: string
    start_time: string
    end_time: null
    duration: number
    duration_text: string
    total_score: string
    actual_score: string
    question_scores: {
        is_correct: boolean
        max_score: string
        score: string
        question_id: number
    }[]
}

// 当前答题记录下的 题目详情
export interface SingleItem {
    additional_first_name: string
    additional_last_name: string
    answer_id: number
    duration: number
    duration_text: string
    end_time: string
    grade_answer: GradeAnswer
    question: QuestionItem
    question_id: number
    quiz_description: string
    quiz_id: number
    quiz_pass_score: string
    quiz_question_num: number
    quiz_title: string
    quiz_total_score: string
    start_time: string
    status: number
    status_text: string
    student_code: string
    student_email: string
    student_id: number
    student_name: string
}
